package com.atguigu.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Accessors(chain = true)
@TableName(value = "t_user")  // 设置表名 默认将类名作为表名
public class User implements Serializable {
    @TableId(value = "id",type = IdType.AUTO)// 默认是字段名, 自增
    private int id;

    //@TableField(value = "last_name")
    private String lastName;
    private int age;
    private Date bir;

    @TableField(exist = false)// 不映射表中的任何字段
    private String aaa;
}
